import axios from 'axios'


export const getNews=(data)=>{
    return {
        type: 'HOTPRO',
        payload:data
    }
}


export const HotPro=()=>{
    return (dispatch)=>{
        const url=`http://129.211.16.185:3000/product?_limit=15&_sort=time&_order=DESC`
        axios({
            url:url,
            method:"get"
        }).then(res=>{
            dispatch(getNews(res.data));
        })
    }
    
}